#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    ,i(0)
{
    ui->setupUi(this);

    myButton = new QPushButton(this);
    myButton->setText("fxxk u!");

    // 设置按钮大小
    myButton->setFixedSize(150, 50);
    // 设置按钮位置为
    myButton->move(100, 100);

    connect(myButton, &QPushButton::clicked,this,&Widget::handleClick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{
    myButton->setText("fxxk u! "+QString::number(i));
    i++;
}

